#817: TUI runs two double-click detectors — adopt quadraui DoubleClickDetector and delete the hand-rolled 400ms window - #844
Merged
JDonaghy merged 2 commits intoSep 5, 2026
Conversation
… timer mouse::handle_mouse ran a second, independent 400ms/position double-click detector (last_click_time/last_click_pos) at five sites, racing the DoubleClickDetector TuiBackend already runs to produce the UiEvent::DoubleClick that reaches TuiShellApp::handle_mouse_event. Replace the hand-rolled state with a single `is_double_click: bool` parameter captured from the real UiEvent::DoubleClick before it's folded to a crossterm MouseEvent, and read it directly at all five sites (find/replace input, ext panel row, git/sc sidebar row, settings row, editor word-select) instead of re-deriving it. Net effect: handle_mouse drops from 33 to 32 parameters (one hand-rolled timer's worth), and the two detectors that could disagree collapse into one. GTK already routes UiEvent::DoubleClick straight to its handlers with no duplicate detector — no change needed there. Adds two black-box regression tests via TuiDriver: double-click word selection in the editor (using TuiDriver::double_click, quadraui#592's deterministic non-wall-clock double-click event) and double-click toggling a boolean settings row. Both were verified red against the pre-fix behavior (is_double hardcoded false) and green with the fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…nd SC-sidebar sites The review flagged that the original fix removed the hand-rolled 400ms detector at all five mouse.rs call sites but only added regression tests for two (editor word-select, settings toggle). Add the two the issue's Acceptance section names explicitly: - tui_ext_panel_double_click_on_a_section_header_does_not_toggle_it: double-clicking an extension-panel section header must not toggle its expand/collapse state (handle_ext_panel_double_click no-ops on header rows; the single-click Return toggle must be suppressed). - tui_sc_sidebar_double_click_on_a_changed_file_opens_it: double-clicking a changed file's row in the source-control sidebar must open it via sc_activate_row, same as double-clicking a file in the Explorer. Both use TuiDriver::double_click to deliver a single synthetic UiEvent::DoubleClick with no preceding click, and both were verified RED (by temporarily hardcoding each arm's is_double to false) against the behavior the deleted hand-rolled detector would have produced for a lone injected event: no prior last_click_time to compare against, so it would have read as an ordinary first click. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #817
Automated PR opened by coordinator for review of issue #817.